import request from '@/common/request'

// 数据大屏接口
export function getScreenData() {
  return request({
    url: '/apiadmin/screen/data',
    method: 'get'
  })
}

// 控场大屏接口
export function getScreenControl() {
  return request({
    url: '/apiadmin/screen/control',
    method: 'get'
  })
}

//获取违禁词列表
export function getIllegalList(data) {
    return request({
        url: '/apiadmin/screen/illegal',
        method: 'post',
        data:data
    })
}

/**
 * 直播信息
 * @param data
 * data.liveId  直播ID
 * @returns {AxiosPromise}
 */
export function getLiveInfo(data) {
    return request({
        url: '/apiadmin/live/manager/info',
        method: 'post',
        data:data
    })
}

/**
 * 发送命令
 * @param data
 * data.chartId  组ID
 * data.command  命令内容
 * @returns {AxiosPromise}
 */
export function sendCommand(data) {
  return request({
    url: '/apiadmin/liveinfo/sendCommand',
    method: 'post',
	data:data
  })
}
export function sendCommandCmd(data) {
    return request({
        url: '/apiadmin/liveinfo/cmd',
        method: 'post',
        data:data
    })
}
export function sendLotter(data) {
    return request({
        url: '/apiadmin/lotter/sendLotter',
        method: 'post',
        data:data
    })
}
//关闭直播
export function sendEndLive(data) {
  return request({
    url: '/apiadmin/manager/live/end',
    method: 'post',
	data:data
  })
}

// 违禁词检测接口
export function isSilence(data) {
    let parameter = {
        CallbackCommand: 'Group.CallbackBeforeSendMsg',
        GroupId: data.group_id,
        From_Account: 'administrator',
        Operator_Account: 'administrator',
        MsgBody: [
            {
                MsgType: 'TIMTextElem',
                MsgContent: {
                    Text: data.msg_text
                }
            }
        ],
        CloudCustomData: data.ccd,
    };
    return request({
        url: '/apiadmin/callback/im?CallbackCommand=Group.CallbackBeforeSendMsg',
        method: 'post',
        data: parameter
    })
}

export function shujukanban(data) {
  return request({
    url: '/apiadmin/screen/shujukanban',
    method: 'post',
	data:data
  })
}

export function realStatistics(data) {
  return request({
    url: '/apiadmin/screen/realStatistics',
    method: 'post',
	data:data
  })
}
